package test.marui.com.mytest.view.layerView;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import test.marui.com.mytest.R;

/**
 * Created by MR on 2019/1/25.
 */
public class LayerActivity extends AppCompatActivity implements View.OnClickListener {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_layer);

        View tv_screen = findViewById(R.id.tv_screen);
        View tv_full_screen = findViewById(R.id.tv_full_screen);

        tv_screen.setOnClickListener(this);
        tv_full_screen.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_screen:
                Intent intent = new Intent(LayerActivity.this, LayerNormalActivity.class);
                intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
                startActivity(intent);
                overridePendingTransition(R.anim.fade_right_in, R.anim.fade_left_out);
                break;
            case R.id.tv_full_screen:
                Intent intent1 = new Intent(LayerActivity.this, LayerFullScreenActivity.class);
                intent1.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
                startActivity(intent1);
                break;
        }
    }
}
